package com.ywm.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@ApiModel(value = "评论", description = "评论内容")
@TableName("content")
@Data
public class Content implements Serializable {

    @ApiModelProperty(value = "评论id")
    @TableId(type = IdType.ASSIGN_ID)
    private String contentId;

    @ApiModelProperty(value = "用户名")
        private String userName;

    @ApiModelProperty("用户id")
    private String userId;

    @ApiModelProperty("评论内容")
    private String content;

    @ApiModelProperty("博客id")
    private String blogId;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime creationDate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "最后更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime lastUpdateDate;

    @ApiModelProperty(value = "乐观锁")
    @Version
    private Integer version;

    @ApiModelProperty(value = "逻辑删除")
    @TableLogic
    private Integer isDeleted;
}
